from dataclasses import dataclass
from typing import Self

from poker_bot.core.models.enums.account import AccountStatus


@dataclass
class AccountEntity:
    user_id: int
    account_id: int
    id: int | None = None
    status: AccountStatus | None = None

    @classmethod
    def create(cls, user_id: int, account_id: int) -> Self:
        account = cls(user_id=user_id, account_id=account_id)
        return account

    def update_status(self, new_status: AccountStatus):
        self.status = new_status
